import django_filters
from .models import ProductModel


class ProductFilter(django_filters.FilterSet):
    product_code = django_filters.CharFilter(lookup_expr='icontains')
    update_datetime = django_filters.DateTimeFilter(lookup_expr='gte')  # 大于或等于某个日期

    class Meta:
        model = ProductModel
        fields = ['product_code', 'update_datetime']
